<?php

//列表页控制器
class DaohangController extends Controller{
	private $model;
	
	public function __init(){
		$this->model=K('Daohang');
	}
	
	public function index(){
		$data=$this->model->where('pid=0')->all();
		foreach ($data as $k => $v) {
			$data[$k]['son']=$this->model->where("pid={$v['cid']}")->all();
		}
		
		$this->assign('data',$data);
		$this->display();
	}
}


?>